package ycl.base.common.base.service;

import com.baomidou.mybatisplus.extension.service.IService;
import ycl.base.common.base.entity.BaseEntity;
import ycl.base.common.models.base.PageParams;
import ycl.base.common.models.base.QueryPage;
import ycl.base.common.models.res.login.LoginRes;

import javax.servlet.http.HttpServletRequest;

/**
 * 逻辑层基类
 *
 * @author: YCL
 * @date: 2021-06-04 23:59:56
 */
public interface BaseService<T extends BaseEntity> extends IService<T> {

	/**
	 * 查看用户是否登录
	 * @param request 请求头
	 * @return TF
	 */
	boolean isLogin(HttpServletRequest request);

	LoginRes getLoginUser(HttpServletRequest request);

	LoginRes getLoginUserNotThrow(HttpServletRequest request);

	Long getLoginUserId(HttpServletRequest request);

	Long getLoginUserIdNotThrow(HttpServletRequest request);

	QueryPage<T> findPage(PageParams params, T query);
}
